﻿using System.Windows.Controls;
using System.Windows.Input;
using CPETwit.WPFClient.Common;
using CPETwit.WPFClient.ViewModel;

namespace CPETwit.WPFClient.UC
{
    /// <summary>
    /// Logique d'interaction pour ResearchUsers.xaml
    /// </summary>
    public partial class ResearchUsers : UserControl
    {
        public ResearchUsers()
        {
            InitializeComponent();
        }

        private void CustomTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            TextBox textBox = sender as TextBox;
            if (textBox != null)
            {
                if (e.Key == Key.Enter)
                {
                    ResearchUsersViewModel viewModel = textBox.DataContext as ResearchUsersViewModel;
                    viewModel.Research = textBox.Text;
                }
            }
        }
    }
}
